﻿namespace Borg.AttributeAnalyze.Result
{
    public class MissingInterface : ResultBase
    {
        private readonly PlugTypeInfo _plug;
        private readonly SlotDefinition _slotDefinition;

        public MissingInterface(PlugTypeInfo plug, SlotDefinition slotDefinition)
            : base(plug.Assembly, Component.Plug, ResultType.MissingInterface, plug, plug.ExtensionTypeInfo)
        {
            _plug = plug;
            _slotDefinition = slotDefinition;
        }

        public override string ToMsBuildMessageString()
        {
            return string.Format(
                "plug does not implement interface\n{1}slot name: {2}\n{1}class: {3}\n{1}interface: {0}",
                new object[] { _slotDefinition.TypeName, GetWhiteSpace(2), _slotDefinition.Name, TypeName });
        }

        public override MessageType MessageType
        {
            get { return MessageType.Error; }
        }
    }
}

